package com.hxzf.mvp.service.dto;

import com.hxzf.mvp.commons.annotation.EndDate;
import com.hxzf.mvp.commons.annotation.Phone;
import com.hxzf.mvp.commons.annotation.StartDate;
import com.hxzf.mvp.commons.domain.QueryBase;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Email;
import java.util.Date;

/**
 * 用户实体查询条件
 *
 * <p>继承{@link QueryBase}后自动具备分页能力，可以在XML Mapper中直接使用。
 *
 * @author Kai
 * @date 2021/6/24 14:25
 **/
@Getter
@Setter
@ApiModel(value = "UserQuery", description = "用户信息查询参数（支持范围及模糊查询）")
public class UserQuery extends QueryBase {

    @ApiModelProperty(name = "username", value = "用户名，向后模糊匹配。", example = "harry")
    private String username;

    @ApiModelProperty(name = "regDateStart", value = "注册时间查询开始时间。", example = "2021-01-01")
    @StartDate
    private Date regDateStart;

    @ApiModelProperty(name = "regDateEnd", value = "注册时间查询结束时间。", example = "2021-01-31")
    @EndDate
    private Date regDateEnd;

    @ApiModelProperty(name = "tel", value = "手机号码。", example = "13400000000")
    @Phone
    private String tel;

    @Email(message = "电子邮件格式错误！")
    @ApiModelProperty(name = "email", value = "电子邮件", example = "guest@163.com")
    private String email;

    // u can add any params here...
}
